@extends('common.base-master')

@section('html-head')
{{--    <link href="{{url('css/admin/pagenum.css')}}" rel="stylesheet" />--}}
@endsection

@section('html-body')
    <div class="neibanner" style="@if(!empty($classifyName))background:url({{$classifyName->img_url}}) @endif no-repeat 50%; background-size: cover;"></div>
    <div class="probox">
        <div class="proxiala">
            <div class="proxiala_chakan">
                查看更多环保知识类型
            </div>
            <div class="proxiala_menu">
                <a class="on" href="{{route('Home.Index.contact')}}">联系我们</a>
                <div class="clear"></div>
            </div>
        </div>
        <div class="probox_left">
            <div class="protitle" style="background-color: #43a906;">
                <div>
                    <div class="protitle1" style="text-align: center; ">
                        @if(!empty($classifyName))
                            {{$classifyName->name}}
                        @else
                            联系我们
                        @endif
                    </div>
                </div>
            </div>
            <div class="proleft_xiala">
                <a class="on" href="{{route('Home.Index.contact')}}">联系我们</a>
                <div class="clear"></div>
            </div>
        </div>
        <div class="probox_right">
            <div class="proboxline">
                <div class="proboxline_box">

                    <div class="office" style="margin-left: 15px;">
                        <div class="title">
                            <h5>联系方式</h5>
                        </div>
                        <div class="office_location">
                            <div class="address">
                                <i class="fa fa-map-marker"><span>新西兰地址：Level 5，The Shortland Centre， 55 Shortland Street，Auckland1010，New Zealand</span></i>
                            </div>
                            <div class="phone">
                                <i class="fa fa-phone"><span>国内联系电话：13711346251（龙先生，中国区商务代表）</span></i>
                            </div>
                            {{--						<div class="email">--}}
                            {{--							<i class="fa fa-envelope"><span>youremail@mail.com</span></i>--}}
                            {{--						</div>--}}
                        </div>
                    </div>

                    <div class="msg">
                        <div class="msg_title">
                            <h5>留言</h5>
                        </div>
                        <div class="form_area">
                            <!-- CONTACT FORM -->
                            <div class="contact-form wow fadeIn animated" data-wow-offset="10" data-wow-duration="1.5s">
                                <div id="message"></div>
                                <form >
                                    <div class="form-group">
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="name" id="name" placeholder="姓名">
                                        </div>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="email" id="email" placeholder="邮箱">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-12">
                                            <input type="subject" class="form-control" id="subject" placeholder="标题">
                                            <div class="text_area">
                                                <textarea name="contact-message" id="msg" class="form-control" cols="30" rows="8" placeholder="内容"></textarea>
                                            </div>
                                            <a type="submit" id="subThisForm" class="custom-btn" style="width:100px;height:50px;text-align: center;line-height: 50px;">发送</a>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>
        </div>
        <div class="clear"></div>
    </div>

<script>

    $(function(){
        $(document).on('click', '#subThisForm', function () {
            var name     = $('#name').val();
            var email    = $('#email').val();
            var subject  = $('#subject').val();
            var msg      = $('#msg').val();

            $.ajax({
                url: '{{route("Api.Admin.sys.addOnline")}}',
                type: 'post',
                dataType: 'json',
                data: {
                    name:name,
                    email:email,
                    subject:subject,
                    msg:msg,
                    type:'zh',
                },
                success: function (obj) {
                    if (obj.level == "success") {
                        noty({
                            text: obj.message, type: obj.level, timeout: 600,
                            callback: {
                                afterClose:function(){
                                    window.location.reload();
                                }
                            }
                        });
                    } else if (obj.level == "error") {
                        noty({text: obj.message, type: obj.level, timeout: 600});
                    }

                },
                error: function (obj) {
                    console.log(obj);
                }
            });
        });
    });
</script>
@endsection

